#include<iostream>
#include<cstdlib>
#include<string>
#include<cerrno>
#include<sys/types.h>
#include<unistd.h>
#include<signal.h>
#include<cstring>
using std::cout;
using std::endl;
using std::cerr;
using std::string;
void usage(const string& proc)
{
    cout<<"Usage:\n\t"<<proc<<"sig pid"<<endl;
}
int main(int argc,char* argv[])
{
    if(argc!=3){
        usage(argv[0]);
        exit(1);
    }
    if(kill((pid_t)atoi(argv[2]),atoi(argv[1]))==-1){
        cerr<<"kill error,"<<strerror(errno)<<endl;
        exit(2);
    }
    return 0;
}
